﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace DZ
{
    /// <summary>
    /// Interaction logic for Selection.xaml
    /// </summary>
    public partial class Selection : Window
    {
        //ASWCommon objASWCommon = new ASWCommon();
        DZAswCommon objASWCommon = new DZAswCommon();

        public Selection()
        {
            InitializeComponent();
        }


        private void bntProceed_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (rdbRun.IsChecked == false && rdbInstantCalibration .IsChecked == false && rdbMaintainance .IsChecked == false && rdbService .IsChecked == false)
                {
                   objASWCommon.ShowMessage("Please Select Option ");
                   return;
                 }
               if (rdbRun.IsChecked  == true)
                {
                    this.Hide();
                    var frmMainRunWindow = new Forms. MainWindow();
                    frmMainRunWindow.Closed += (s, args) => this.Close();
                    frmMainRunWindow.ShowDialog();
                    

                }
                else if(rdbInstantCalibration .IsChecked  == true)
               {
                   this.Hide();
                   var frmInstantCalibrationWindow = new InstantCalibration ();
                   frmInstantCalibrationWindow.Closed += (s, args) => this.Close();
                   frmInstantCalibrationWindow.ShowDialog();
                  
                }
               else if (rdbService.IsChecked == true)
               {
                   this.Hide();
                   var frmServiceWindow = new Service();
                   frmServiceWindow.Closed += (s, args) => this.Close();
                   frmServiceWindow.ShowDialog();
                   
               }
               else if (rdbMaintainance.IsChecked == true)
               {
                   this.Hide();
                   var frmMaintainanceWindow = new Maintainance();
                   frmMaintainanceWindow.Closed += (s, args) => this.Close();
                   frmMaintainanceWindow.ShowDialog();
                   
               }
              
            }
            catch (Exception ex)
            {
                //  objASWCommon.ErrorLog(ex);
                ClsCommon.ErrorLog(ex.ToString());
                //return false;
            }                   



        }
    }
}
